﻿using System;
using System.Reflection;
using System.Runtime.InteropServices.WindowsRuntime;
using Framework.Extension;
using Game;
using UnityEngine;
using UnityEngine.Rendering;



namespace Framework.MVC.View
{
    
    public class ViewBase : MonoBehaviour
    {
        public static string viewPath = "";

        public static T Load<T>() where  T : ViewBase
        {
            var a = typeof(T).GetFileRecursion("viewPath");
            var realViewPath = (string)a.GetValue(null);
            var obj = Resources.Load<GameObject>(realViewPath);
            return obj.GetComponent<T>();
            
        }
        

        public string viewName;
        public void Destroy()
        {
            
        }
    }
    
    
}